Package-level declarations

Contains core declarations.

Types

Link copied to clipboard
interface ExplicitInt

Representation of explicit integers.

Link copied to clipboard
@Serializable(with = NegativeIntSerializer::class)
value class NegativeInt : ExplicitInt, Comparable<NegativeInt>

Representation of negative integers, including zero.

Link copied to clipboard
@Serializable(with = NonZeroIntSerializer::class)
value class NonZeroInt : ExplicitInt, Comparable<NonZeroInt>

Representation of integers other than zero.

Link copied to clipboard
@Serializable(with = NotBlankStringSerializer::class)
value class NotBlankString : Comparable<NotBlankString>

Representation of strings that have at least one character, excluding whitespaces.

Link copied to clipboard
@Serializable(with = NotEmptyListSerializer::class)
class NotEmptyList<out E> : List<E>

Representation of lists that contain at least one element.

Link copied to clipboard
@Serializable(with = NotEmptyMapSerializer::class)
class NotEmptyMap<K, out V> : Map<K, V>

Representation of maps that contain at least one entry.

Link copied to clipboard
@Serializable(with = NotEmptySetSerializer::class)
class NotEmptySet<out E> : Set<E>

Representation of sets that contain at least one element.

Link copied to clipboard
@Serializable(with = PositiveIntSerializer::class)
value class PositiveInt : ExplicitInt, Comparable<PositiveInt>

Representation of positive integers, including zero.

Link copied to clipboard
@Serializable(with = StrictlyNegativeIntSerializer::class)
value class StrictlyNegativeInt : ExplicitInt, Comparable<StrictlyNegativeInt>

Representation of strictly negative integers, excluding zero.

Link copied to clipboard
@Serializable(with = StrictlyPositiveIntSerializer::class)
value class StrictlyPositiveInt : ExplicitInt, Comparable<StrictlyPositiveInt>

Representation of strictly positive integers, excluding zero.

Functions

Link copied to clipboard
fun <E> notEmptyListOf(head: E, vararg tail: E): NotEmptyList<E>

Creates a NotEmptyList starting with a head and containing all the elements of the optional tail.

Link copied to clipboard
fun <K, V> notEmptyMapOf(head: Pair<K, V>, vararg tail: Pair<K, V>): NotEmptyMap<K, V>

Creates a NotEmptyMap starting with a head and containing all the entries of the optional tail.

Link copied to clipboard
fun <E> notEmptySetOf(head: E, vararg tail: E): NotEmptySet<E>

Creates a NotEmptySet starting with a head and containing all the elements of the optional tail.

Link copied to clipboard

Returns this integer as a NegativeInt, or IllegalArgumentException if this integer is strictly positive.

Link copied to clipboard

Returns this integer as a NonZeroInt, or IllegalArgumentException if this integer equals zero.

Link copied to clipboard

Returns this string as a NotBlankString, or IllegalArgumentException if this string is blank.

Link copied to clipboard

Returns a NotEmptyList containing all the elements of this collection, or an IllegalArgumentException if this collection is empty.

Link copied to clipboard

Returns a NotEmptyMap containing all the entries of this map, or an IllegalArgumentException if this map is empty.

Link copied to clipboard

Returns a NotEmptySet containing all the elements of this collection, or an IllegalArgumentException if this collection is empty.

Link copied to clipboard

Returns this integer as a PositiveInt, or IllegalArgumentException if this integer is strictly negative.

Link copied to clipboard

Returns this integer as a StrictlyNegativeInt, or IllegalArgumentException if this integer is positive.

Link copied to clipboard

Returns this integer as a StrictlyPositiveInt, or IllegalArgumentException if this integer is negative.